| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | // Importers should always start with this |
||
| 16 | PassmanImporter.zohoCsv.readFile = function (file_data) { |
||
| 17 | return new C_Promise(function(){ |
||
| 18 | var parsed_csv = PassmanImporter.readCsv(file_data, false); |
||
| 19 | var credential_list = []; |
||
| 20 | for (var i = 0; i < parsed_csv.length; i++) { |
||
| 21 | var row = parsed_csv[i]; |
||
| 22 | var _credential = PassmanImporter.newCredential(); |
||
| 23 | _credential.label = row[0]; |
||
| 24 | _credential.username = row[3]; |
||
| 25 | _credential.password = row[4]; |
||
| 26 | _credential.url = row[1]; |
||
| 27 | _credential.description = row[2]; |
||
| 28 | if(_credential.label){ |
||
| 29 | credential_list.push(_credential); |
||
| 30 | } |
||
| 31 | |||
| 32 | var progress = { |
||
| 33 | percent: i/parsed_csv.length*100, |
||
| 34 | loaded: i, |
||
| 35 | total: parsed_csv.length |
||
| 36 | }; |
||
| 37 | |||
| 38 | this.call_progress(progress); |
||
| 39 | } |
||
| 40 | this.call_then(credential_list); |
||
| 41 | }) |
||
| 42 | }; |
||
| 43 | })(window, $, PassmanImporter); |
||
| 44 |